<template>
  <div v-if="movieDetailInfo">
    <top-info :top-info="movieDetailInfo"/>
    <down-info :down-info="movieDetailInfo"/>
  </div>
</template>

<script>
import TopInfo from "@/views/movie/movie_detail/top_info/TopInfo";
import DownInfo from "@/views/movie/movie_detail/down_info/DownInfo";
import * as mutationsTypes from '@/store/mutations-types'

export default {
  name: "MovieDetail",
  components: {
    TopInfo,
    DownInfo,
  },
  data() {
    return {
      addRemarkVisible: false,
      movieDetailInfo: ''
    }
  },
  methods: {
    getMovieDetailInfo() {
      let movieId = this.$store.getters.getMovieId
      this.$http({
        url: `/web/movie/info/detail/${movieId}/${this.$store.state.user.userId}`,
        method: 'get'
      }).then(({data}) => {
        this.movieDetailInfo = data.data
        this.$store.commit(mutationsTypes.SET_MOVIE_INFO_DETAIL, this.movieDetailInfo)
      })
    }
  },
  created() {
    this.getMovieDetailInfo();
  }
}
</script>

<style scoped>
</style>
